<?php include('./templete/public/head.php') ?>
<!--<div class="head">-->
<!--    <div class="headpd">-->
<!--        <a class="iconfont posiabstion" href="javascript:history.go(-1)">&#xe606;</a>-->
<!--        在线留言-->
<!--    </div>-->
<!--</div>-->
<!--<hr style="height: .6rem;border: none;margin: 0;"/>-->

<div class="head">
    <div class="headpd">
        <?php echo $rows['name'] ?>
    </div>
</div>
<hr style="height: .6rem;border: none;margin: 0;"/>
<div class="project-money clearfix">
    <div class="clearfix w100">
        <span class="fl w25">申请人</span>
        <span class="red fl"><?php echo $rows['username'] ?></span>
    </div>
</div>
<div class="project-money clearfix">
    <div class="clearfix w100">
        <span class="fl w25">意向车型</span>
        <span class="red fl"><?php echo $rows['yixiang'] ?></span>
    </div>
</div>
<div class="project-money clearfix">
    <div class="clearfix w100">
        <span class="fl w25">联系电话</span>
        <span class="red fl"><?php echo $rows['phone'] ?></span>
    </div>
</div>
<div class="leave-table">
    <form action="<?php echo url('index')?>">
        <table>
            <tr>
                <td width="30%">跟进负责人</td>
                <td width="70%"><input type="text" id="username" placeholder="请输入跟进负责人"/></td>
            </tr>
            <tr>
                <td width="30%">跟进记录</td>
                <td width="70%"><textarea id="content" placeholder="请输入跟进记录"></textarea></td>
            </tr>
        </table>
</div>
<hr class="eee"/>
<div class="btn"><a >提交</a></div>
</form>
<!--footer-->
<script>
    $('.btn').click(function () {
        var username = $('#username').val();
        if(!username){
            layer.msg('请输入您的姓名');return false;
        }
        if(username.length>8){
            layer.msg('姓名长度过长');return false;
        }
        var content =$('#content').val();
        if(!content){
            layer.msg('请输入跟进记录');return false;
        }
        $.ajax({
            url:'<?php echo url('history?id='.$rows['id'])?>',
            type:'post',
            dataType:'json',
            data:{
                username:username,
                content:content
            },
            success:function (data) {
                if(data.code==1){
                    layer.msg(data.msg);
                    window.location.href = data.url;
                }else{
                    layer.msg(data.msg);
                }
            }
        })
    })
</script>